package com.mr.reducejoin;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;

public class JoinBean implements Writable{
	
	private String orderId;
	private String pId;
	private String pName;
	private String amount;
	private String source;
	
	public JoinBean() {
		
	}
	
	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public String getpId() {
		return pId;
	}

	public void setpId(String pId) {
		this.pId = pId;
	}

	public String getpName() {
		return pName;
	}

	public void setpName(String pName) {
		this.pName = pName;
	}

	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}
	
	

	@Override
	public String toString() {
		return orderId + "\t" + pName + "\t" + amount;
	}

	@Override
	public void write(DataOutput out) throws IOException {

		out.writeUTF(orderId);
		out.writeUTF(pId);
		out.writeUTF(pName);
		out.writeUTF(amount);
		out.writeUTF(source);
		
	}

	@Override
	public void readFields(DataInput in) throws IOException {

		orderId = in.readUTF();
		pId = in.readUTF();
		pName = in.readUTF();
		amount = in.readUTF();
		source = in.readUTF();
		
	}

}
